﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;

public class UIBase : MonoBehaviour
{

    public GameObject blackObj;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void SetTipsPanel(string str) {
        GameObject tipObj = Instantiate(Resources.Load<GameObject>("TipPanel"),GameObject.Find("Canvas").transform);
        tipObj.GetComponent<TipPanelManager>().TipsInit(str);
    }
    public void QuitGame() {
        Application.Quit();
    }
    public void BlackInit()
    {
        GameObject obj2 = Resources.Load<GameObject>("Black");
        blackObj = Instantiate(obj2, GameObject.Find("Canvas").transform);
        blackObj.GetComponent<Image>().DOColor(new Color(0, 0, 0, 0), 1.5f);
        Destroy(blackObj, 1.5f);
    }
    public void BlackOut()
    {
        GameObject obj2 = Resources.Load<GameObject>("Black");
        blackObj = Instantiate(obj2, GameObject.Find("Canvas").transform);
        blackObj.GetComponent<Image>().color = new Color(0, 0, 0, 0);
        blackObj.GetComponent<Image>().DOColor(new Color(0, 0, 0, 1), 1.5f);
        Destroy(blackObj, 1.5f);
    }
}
